package com.power.sifa.approve.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.stereotype.Component;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  业务申请主表实体类
*/

@Entity
@ApiModel(value="业务申请主表")
@Data
@Table(name="Apl_main",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_main.Apl_mainPK.class) 用于复合组件
public class Apl_main extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "毫秒+nanoid")
    private String id;

    @ApiModelProperty(value = "申请流水号")
    private String applycode;

    @ApiModelProperty(value = "申请标题")
    private String title;

    @ApiModelProperty(value = "申请类型id")
    private String matid;

    @ApiModelProperty(value = "申请来源")
    private Integer source;

    @ApiModelProperty(value = "录入人id")
    private String reguserid;

    @ApiModelProperty(value = "录入人")
    private String regusername;

    @ApiModelProperty(value = "录入/拟受理单位id")
    private String regsectionid;

    @ApiModelProperty(value = "录入/拟受理单位")
    private String regsectionname;

    @ApiModelProperty(value = "创建时间")
    private String createtime;

    @ApiModelProperty(value = "最后修改时间")
    private String updatetime;

    @ApiModelProperty(value = "提交时间")
    private String subtime;

    @ApiModelProperty(value = "案件号")
    private String acceptcode;

    @ApiModelProperty(value = "受理时间")
    private String accepttime;

    @ApiModelProperty(value = "受理人id")
    private String acceptuserid;

    @ApiModelProperty(value = "受理人")
    private String acceptusername;

    @ApiModelProperty(value = "受理部门id")
    private String acceptdeptid;

    @ApiModelProperty(value = "受理部门")
    private String acceptdeptname;

    @ApiModelProperty(value = "受理单位id")
    private String acceptsectionid;

    @ApiModelProperty(value = "受理单位")
    private String acceptsectionname;

    @ApiModelProperty(value = "受理单位行政区划id")
    private String acceptadid;

    @ApiModelProperty(value = "办结时间")
    private String finishtime;

    @ApiModelProperty(value = "表单id")
    private String formid;

    @ApiModelProperty(value = "流程实例id")
    private String instid;

    /**
     * 业务类型枚举类
     * {@link com.power.sifa.approve.model.enumeration.St_apply}
     */
    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "办结时限环节组id")
    private String scatid;

    @ApiModelProperty(value = "申请人")
    private String applyname;

    @ApiModelProperty(value = "异常状态前的备份状态")
    private Integer statuscp;

    @ApiModelProperty(value = "归档时间")
    private String archivetime;
    /**
     *  申请来源文本
     */
    @Transient
    @FieldEnumText(eum="Tp_applysource", valuefield="source")
    private String source_text;

    /**
     *  状态文本
     */
    @Transient
    @FieldEnumText(eum="St_apply", valuefield="status")
    private String status_text;




    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_mainPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_mainPK pk = (Apl_mainPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

    @Override
    public Map<String, Object> parseMap() {
        return null;
    }

}
